var mongoose=require('mongoose');

var Schema= mongoose.Schema;
//连接数据库
mongoose.connect('mongodb://localhost/test');

var UserShema = new Schema({
    name : {
        type:String,
        required:true
        },
    password : {
        type:String,
        required:true
    }


})


//将文档发布模型
var st = mongoose.model('st', UserShema);

/* var st=new st({
     name:"黄诚大哥哥",
     password:"99999"
 })

st.save(function (err,ok) {

    if(err){
        console.log("错误")
    }
    else {
        console.log(ok)
    }
})*/



module.exports=mongoose.model('st', UserShema);
